import request from '@/utils/request'

// 能力模型列表
export function energyList(query) {
    return request({
        url: '/pla/targetModel/list',
        method: 'get',
        params: query
    })
}

/**
 * 能力模型添加
 * @param {*} data 
 * @returns 
 */
export function energyAdd(data) {
    return request({
        url: '/pla/targetModel',
        method: 'post',
        data: data
    })
}

/**
 * 能力模型删除
 * @param {*} energyId 
 * @returns 
 */
export function energyDelete(targetModelId) {
    return request({
        url: '/pla/targetModel/' + targetModelId,
        method: 'delete',
    })
}

/**
 * 能力模型编辑
 * @param {*} data 
 * @returns 
 */
export function energyUpdate(data) {
    return request({
        url: '/pla/targetModel',
        method: 'put',
        data: data
    })
}

/**
 * 指标添加
 * @param {*} data 
 * @returns 
 */
export function ModelIndexAdd(data) {
    return request({
        url: '/pla/model',
        method: 'post',
        data: data
    })
}

/**
 * 指标添加
 * @param {*} data 
 * @returns 
 */
export function IndexList(targetModelId) {
    return request({
        url: '/pla/model/list?' + 'targetModelId=' + targetModelId,
        method: 'get',
    })
}


/**
 * 指标删除
 * @param {*} targetModelId 
 * @returns 
 */
export function IndexDelete(targetModelId) {
    return request({
        url: '/pla/model/' + targetModelId,
        method: 'delete',
    })
}

/**
 * 指标删除
 * @param {*} data 
 * @returns 
 */
export function ModelIndexUpdate(data) {
    return request({
        url: '/pla/model',
        method: 'put',
        data: data
    })
}